import Mock from 'mockjs'

const data = Mock.mock({
  'items': [
    {
      id: 0,
      name: '默认'
    },
    {
      id: 5,
      name: '汉堡'
    },
    {
      id: 3,
      name: '汽水'
    }
  ]
})

export default [
  {
    url: '/dishesSeries',
    type: 'get',
    response: config => {
      const items = data.items
      return {
        code: 200,
        data: items
      }
    }
  },
  {
    url: '/dishesSeries/0',
    type: 'get',
    response: config => {
      const item = data.items[0]
      return {
        code: 200,
        data: item
      }
    }
  },
  {
    url: '/dishesSeries/1',
    method: 'get',
    response: config => {
      const item = data.items[1]
      return {
        code: 200,
        data: item
      }
    }
  },
  {
    url: '/dishesSeries/2',
    method: 'get',
    response: config => {
      const item = data.items[2]
      return {
        code: 200,
        data: item
      }
    }
  }
]
